# 导入所需的模块和类
from flask import Flask, request

from BankGateway import BankGateway

# 创建一个Flask应用
app = Flask(__name__)

# 创建BankGateway实例，传入私钥和公钥
private_key = "<私钥>"
public_key = "<公钥>"
gateway = BankGateway(private_key, public_key)


# 定义HTTP POST路由，用于接收请求
@app.route('/', methods=['POST'])
def process_request():
    # 处理请求
    response_body = gateway.process_request(request)
    return response_body


# 运行Flask应用
if __name__ == '__main__':
    app.run()
